package com.跳台阶问题;

import java.util.ArrayList;
import java.util.List;

public class Test {

	public static void main(String[] args) {
		Solution s = new Solution();
		//System.out.println(s.JumpFloor(2));
		
//		Solution1 s1 = new Solution1();
//		int [] candidates = new int[] {1,2};
//		System.out.println(s1.combinationSum(candidates, 3));
		
		System.out.println(countWays(3));
		
		
	}
	public static int countWays(int n) {
        if(n==1)return 1;
        if(n==2)return 2;
        int dpstep1=1;
        int dpstep2=2;
        int dpstepnow=0;
        for(int i=3;i<=n;i++){
            dpstepnow = dpstep1+dpstep2;
            dpstep1 = dpstep2;
            dpstep2 = dpstepnow;
        }
        return dpstepnow;
        
    }

}
